import 'package:flutter/material.dart';
import 'package:qqmusic/widget/meinfo.dart';
import 'package:qqmusic/widget/meitem.dart';
import 'package:qqmusic/widget/re.dart';
import 'package:qqmusic/widget/search.dart';

class me extends StatefulWidget {
  me({Key key}) : super(key: key);

  @override
  State<me> createState() => _meState();
}

class _meState extends State<me> {
  @override
  Widget build(BuildContext context) {
    return SafeArea(
        child: Column(
      children: [
        Container(
          padding: EdgeInsets.symmetric(horizontal: 15),
          child: Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [
              Column(
                children: [
                  Text(
                    '我的',
                    style: TextStyle(
                        color: Colors.black,
                        fontSize: 18,
                        fontWeight: FontWeight.w700),
                  ),
                  Container(
                    height: 5,
                    margin: EdgeInsets.only(top: 2),
                    width: 35,
                    decoration: BoxDecoration(
                        color: Color(0xff3be68e),
                        borderRadius: BorderRadius.circular(2.5)),
                  )
                ],
              ),
              Container(
                width: 100,
                child: Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: [
                    Icon(
                      Icons.water_damage,
                      color: Colors.orange,
                    ),
                    Icon(Icons.email_outlined),
                    Icon(Icons.menu)
                  ],
                ),
              )
            ],
          ),
        ),
        Expanded(
          child: Container(
            padding: EdgeInsets.symmetric(horizontal: 15),
            child: ListView.builder(
              itemCount: 8,
              itemBuilder: (BuildContext context, int index) {
                if (index == 0) {
                  return search();
                } else if (index == 1) {
                  return meinfo();
                } else if (index == 2) {
                  return meitem(
                    name: '最近播放',
                  );
                } else if (index == 3) {
                  return meitem(
                    name: '自建歌单',
                  );
                } else if (index == 4) {
                  return meitem(
                    name: '收藏歌单',
                  );
                } else if (index == 5) {
                  return meitem(
                    name: 'AI歌单',
                  );
                } else if (index == 6) {
                  return meitem(
                    name: '智能分类',
                  );
                }
                return Container(
                  alignment: Alignment.center,
                  child: Text(
                    '发现更多推荐内容 >',
                    style: TextStyle(color: Colors.grey, fontSize: 12),
                  ),
                );
              },
            ),
          ),
        )
      ],
    ));
  }
}
